<ion-view view-title="绑定存管银行">
    <ion-nav-buttons side="left">
        <back-button></back-button>
    </ion-nav-buttons>
    <ion-content ng-class="{'has-loading': isOffline}">
        <!-- panel -->
        <div class="panel tp" ng-show="param.step == 1">
            <a ng-click="showBankClick()" digital-keyboard=false>
                <div class="item group">
                    <span class="title">选择银行</span>
                    <span ng-class="{'txt_m':true,'placeholder':!param.bank_no}" ng-model="param.bank_name">{{param.bank_name}}</span>
                </div>
            </a>
            <div class="item" ng-show="param.step == 1 && param.contract_way != 2">
                <span class="title">银行卡号</span>
                <input type="tel" class="txt_m jBankCard" ng-model="param.bank_account" placeholder="请输入银行卡卡号"
                       digital-keyboard=false maxlength="23"/>
            </div>
            <div class="item" ng-show="param.step == 1 && param.contract_way != 2 && param.ispwd == 1">
                <span class="title">银行密码</span>
                <input type="password" class="txt_m jPinpad" ng-model="param.bank_pwd" placeholder="{{param.pwd_msg}}" maxlength="6"
                       digital-keyboard="param.bank_pwd"/>
            </div>
        </div>
        <!-- tips -->
        <div class="little-tip" ng-show="param.step == 1 && param.bank_no">
            <div class='clr2' ng-bind-html="param.brief"></div>
            <p>为保障您的银行卡资金安全，天风将为您在银行自动开通三方存管业务（资金由银行存管），无需您再跑银行啦！</p>
        </div>
        <!-- panel -->
        <div class="agree item grp" ng-show="param.step == 1 && param.bank_no">
            <ion-checkbox ng-model="param.agreement"></ion-checkbox>
            <a href="#/trade/agreement?econtract_id={{param.econtract_id}}" ng-click="saveBankInfo()" style="font-size: 14px;">我已阅读并同意签署《客户交易结算资金银行存管协议书》</a>
        </div>
        <!-- panel -->
        <div class="btnbox" ng-show="param.step == 1">
            <a class="btn" ng-click="bindBankClick()">下一步</a>
        </div>
        <!-- panel -->
        <div ng-show="param.step == 2 && param.bind_success==2">
            <div class="panel confirm success">
                <dl>
                    <dt>绑定成功！</dt>
                    <dd>三方存管银行卡：{{param.bank_name}} <span ng-bind-html="param.bank_account_msg"></span></dd>
                </dl>
            </div>
            <!-- button -->
            <div class="btnbox">
                <a class="btn" ng-href="#tab/account-bank">确定</a>
            </div>
        </div>
        <div ng-show="param.step == 2 && param.bind_success==3">
            <div class="panel confirm success">
                <dl>
                    <dt>申请已提交</dt>
                    <dd>系统正在处理中，请稍后查看</dd>
                </dl>
            </div>
            <!-- button -->
            <div class="btnbox">
                <a class="btn" ng-href="#tab/account-bank">确定</a>
            </div>
        </div>
        <!-- panel -->
        <div ng-show="param.step == 2 && !param.bind_success==1">
            <div class="panel confirm fail">
                <dl>
                    <dt>三方存管银行绑定失败！</dt>
                    <dd ng-bind-html="param.fail_info"></dd>
                </dl>
            </div>
            <!-- button -->
            <div class="btnbox" id="">
                <a class="btn" ng-click="reBind()">重新指定存管银行</a>
            </div>
        </div>
    </ion-content>
    <div class="service-tel">客服电话：400 - 800 - 5000</div>
</ion-view>